class BlastGenerator < Rails::Generator::Base
  def manifest
    record do |m|
     ### api => http://api.rubyonrails.org/classes/Rails/Generator/Commands/Create.html

     ### controllers
      m.directory('app/controllers')     
      m.file("app/controllers/blasts_controller.rb", "app/controllers/blasts_controller.rb")
      
      ### helpers
      m.directory('app/helpers')
      m.file("app/helpers/blasts_helper.rb", "app/helpers/blasts_helper.rb")
  
      ### models
      m.file("app/models/blast_mailer.rb", "app/models/blast_mailer.rb")
      m.file("app/models/blast.rb", "app/models/blast.rb")

      ### views
      m.directory('app/views/blast_mailer')
      m.file("app/views/blast_mailer/blast.rhtml", "app/views/blast_mailer/blast.rhtml")
      m.file("app/views/blast_mailer/_user.rhtml", "app/views/blast_mailer/_user.rhtml")

      m.directory File.join('app/views/', "blasts")      
      m.file("app/views/blasts/_form.rhtml", "app/views/blasts/_form.rhtml")
      m.file("app/views/blasts/_blast.rhtml", "app/views/blasts/_blast.rhtml")
      m.file("app/views/blasts/new.html.erb", "app/views/blasts/new.html.erb")
      m.file("app/views/blasts/example.html.erb", "app/views/blasts/example.html.erb")      
      m.file("app/views/blasts/back.html.erb", "app/views/blasts/back.html.erb") 
      m.file('app/views/layouts/blasts.html.erb','app/views/layouts/blasts.html.erb')
      
      ### javascripts ### 
      m.directory('public/javascripts')
      m.file('public/javascripts/blast.js','public/javascripts/blast.js')

      ### stylesheets ### 
      m.directory('public/stylesheets')
      m.file('public/stylesheets/blast.css','public/stylesheets/blast.css')

      ### config ### 
      m.directory('config')
      m.file('config/blasts.yml','config/blasts.yml')

      ### routes
      # m.route_resources("blasts")
       
      ### migration...
      unless options[:skip_migration]
        # m.directory 'db/migrate'
        m.migration_template 'db/migration.rb', 'db/migrate', :migration_file_name => "create_acts_as_blast"
      end



      ### test/fixtures ### 
      m.directory('test/fixtures')
      m.directory('test/fixtures/mailer')
      m.file("test/fixtures/mailer/mailer", "test/fixtures/mailer/mailer")
      m.file("test/fixtures/blasts.yml", "test/fixtures/blasts.yml")
      m.file("test/fixtures/users.yml", "test/fixtures/users.yml")

      ### test/fixtures ### 
      m.directory('test/unit')
      m.file("test/unit/blast_mailer_test.rb", "test/unit/blast_mailer_test.rb")
      m.file("test/unit/blast_test.rb", "test/unit/blast_test.rb")
      
      # m.readme "POST_GENERATION_REMINDER"
    end
  end
end